<template>
    <div>
        <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-card v-for="item in goodsData" :price="item.goods_price" :title="item.goods_name" :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'
            " />
    </div>
</template>

<script setup>
import { searchApi } from '@/api/api';
import router from '@/router';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let route = useRoute()
let goodsData = ref([])
searchApi(route.params.query).then(res => {
    console.log(res);
    goodsData.value = res.data.message.goods
})
const onClickLeft = () => {
    router.push('/')
}
</script>

<style lang="scss" scoped></style>